-- GENERATED SPELL FOR [Murkblood Spearman] --


function spell0_17729(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_17729', 628, 1)
end

function spell1_17729(pUnit, Event) --@Throw,n/a--
pUnit:FullCastSpellOnTarget(22887,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17729', 628, 1)
end

function spell2_17729(pUnit, Event) --@Throw,n/a--
pUnit:FullCastSpellOnTarget(40317,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17729', 589, 1)
end

function spell3_17729(pUnit, Event) --@Viper Sting,Drain--
pUnit:FullCastSpellOnTarget(31407,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_17729', 8000, 1)
end

function spell4_17729(pUnit, Event) --@Viper Sting,Drain--
pUnit:FullCastSpellOnTarget(39413,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_17729', 8000, 1)
end

function Sorts_17729(pUnit, Event)
local choix_sorts_17729 = math.random(0, 4)
if choix_sorts_17729 == 0 then
pUnit:RegisterEvent('spell0_17729', 1, 1)
end
if choix_sorts_17729 == 1 then
pUnit:RegisterEvent('spell1_17729', 1, 1)
end
if choix_sorts_17729 == 2 then
pUnit:RegisterEvent('spell2_17729', 1, 1)
end
if choix_sorts_17729 == 3 then
pUnit:RegisterEvent('spell3_17729', 1, 1)
end
if choix_sorts_17729 == 4 then
pUnit:RegisterEvent('spell4_17729', 1, 1)
end
end

function mob17729_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17729', math.random(1500, 3000), 1)
end

function mob17729_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17729_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17729_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17729, 1, 'mob17729_Action')
RegisterUnitEvent(17729, 2, 'mob17729_Leave')
RegisterUnitEvent(17729, 3, 'mob17729_Kill')
RegisterUnitEvent(17729, 4, 'mob17729_Die')
